package com.example.hellojenkins.demos.web.controller;

import com.example.hellojenkins.demos.web.entity.User;
import com.example.hellojenkins.demos.web.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wzh
 * @since 2024-12-11
 */
@RestController
@RequestMapping("/web/user")
public class UserController {
    @Autowired
    private IUserService userService;
//查询用户
    @PostMapping("/list")
    public String list(){
        List<User> list = userService.list();
        return  list.toString();
    }
}
